<?php

class Error
{
	public static function Database( $mysqli )
	{
		$header = "HTTP/1.0 503 Service Temporarily Unavailable";
		$message = "Could not connect to database.";
		
		Log::Error( "Could not connect to database: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error );
		
		header( $header );
		echo self::BuildMarkup( $header, $message );
		die();
	}

	private static function BuildMarkup( $header, $message )
	{
		return '<!doctype html>
		<html>
			<head>
				<title>Irinori &ndash; Error</title>
			</head>
			<body>
				<h1>Irinori</h1>
				<h2>' . $header . '</h2>
				<p>' . $message . '</p>
			</body>
		</html>';
	}	
}
